@extends('admin.layout.base')
@section('content')
    <div class="panel-content" id="app" v-cloak>
        <div class="panel-body panel-info">
            <el-form :model="form" ref="form" class="form" label-width="100px">
                <div class="panel-header"> <div class="panel-title"> 评价信息 </div> </div>
                <div class="panel-main">
                    <el-form-item label="评价人：" prop="user_name">
                        <el-input clearable v-model="form.user_name" readonly="readonly"></el-input>
                    </el-form-item>
                    <el-form-item label="商品名称：" prop="goods_name">
                        <el-input clearable v-model="form.goods_name" readonly="readonly"></el-input>
                    </el-form-item>
                    <el-form-item label="评价图片：" prop="images">
                        <img v-for="item in form.images" :src="item" width="170" height="150"/>
                    </el-form-item>

                    <el-form-item label="评价内容：" prop="content">
                        <el-input type="textarea" rows="5" v-model="form.content" readonly="readonly"></el-input>
                    </el-form-item>

                    <el-form-item label="评价时间：" prop="created_at">
                        <el-input clearable v-model="form.created_at" readonly="readonly"></el-input>
                    </el-form-item>


                    <el-form-item label="状态：" prop="status_text">
                        <el-input clearable v-model="form.status_text" readonly="readonly"></el-input>
                    </el-form-item>
                </div>


                <el-form-item style="padding-left: 150px;margin-top: 50px">
                    <el-button @click="back()" style="margin-left: 50px">返 回</el-button>
                </el-form-item>
            </el-form>
        </div>
    </div>
@endsection
@section('scripts')
    <script src="{{ asset('neditor/neditor.config.js') }}" type="text/javascript"></script>
    <script src="{{ asset('neditor/neditor.all.min.js') }}" type="text/javascript"></script>
    <script src="{{ asset('neditor/neditor.service.js') }}" type="text/javascript"></script>
    <script src="{{ asset('neditor/i18n/zh-cn/zh-cn.js') }}" type="text/javascript"></script>
    <script src="{{ asset('neditor/third-party/browser-md5-file.min.js') }}" type="text/javascript"></script>
    <script src="{{ asset('neditor/third-party/jquery-1.10.2.min.js') }}" type="text/javascript"></script>
    <script src="{{ asset('js/moment.min.js') }}" type="text/javascript"></script>
    <script>
        $(function () {
            let app = new Vue({
                el: '#app',
                data: function () {
                    return {
                        info: {!! $info !!},
                        form: {
                            id: " {{ $id }}",
                            user_name: '',
                            goods_name: '',
                            images: [],
                            content: '',
                            created_at: '',
                            status: 0,
                            status_text: '',
                        },
                    }
                },
                created() {
                    let that = this;
                    if (this.form.id > 0) {
                        this.form = {
                            id: this.info.id,
                            user_name: this.info.user_name,
                            goods_name: this.info.goods_name,
                            images: this.info.images,
                            content: this.info.content,
                            created_at: this.info.created_at,
                            status: this.info.status,
                            status_text: this.info.status_text,
                        };
                    }

                },
                methods: {
                    //返回
                    back() {
                        window.history.go(-1);
                    },
                }
            });
        })
    </script>
@endsection
